
import java.awt.Graphics;
import java.awt.event.MouseEvent;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author bosco
 */
public class objetoCirculo extends objetoGenerico {
        int xorigen = 0;
        int yorigen = 0;
        int xdestino = 0;
        int ydestino = 0;

    public void mouseDragged( MouseEvent evento )
            {
               xorigen=evento.getX();
               yorigen=evento.getY();
            }
    public void mouseMoved( MouseEvent evento )
            {
               xdestino=evento.getX();
               ydestino=evento.getY();
            }

        objetoCirculo(int pXorigen, int pYorigen, int pXdestino, int pYdestino) {
            xorigen = pXorigen;
            yorigen = pYorigen;
            xdestino = pXdestino;
            ydestino = pYdestino;
            
        }

     public void pinta(Graphics pContexto) {
            
            //pContexto.drawOval(xorigen, yorigen, Event.MOUSE_DRAG, Event.MOUSE_DRAG);
            //pContexto.drawOval(0,0,getSize().width-1,getSize().height-1 );
       //    pContexto.drawOval(mouseDragged(xorigen), mouseDragged(yorigen), mouseMoved(xdestino), mouseMoved(ydestino));
         double radio = Math.sqrt(Math.pow(xdestino - xorigen, 2) + Math.pow(ydestino - yorigen, 2));
         pContexto.drawOval(xorigen - (int)radio, yorigen - (int)radio, (int)radio * 2, (int)radio * 2);
           //pContexto.fillOval(xorigen - (int)radio, yorigen - (int)radio, (int)radio * 2, (int)radio * 2);
    }

  

}
